package com.apes.sms.systemSetting.service;

import com.apes.framework.api.DomainService;
import com.apes.framework.plugin.esb.api.SimpleRequest;
import com.apes.sms.systemSetting.model.ScopeBusiness;
import com.apes.sms.systemSetting.repository.ScopeBusinessRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * Created by lishikun on 2021/12/17 14:23
 */
@Service("scopeBusinessService")
public class ScopeBusinessService extends DomainService {
    @Autowired
    private ScopeBusinessRepository scopeBusinessRepository;


    public ScopeBusiness save(SimpleRequest request) {
        ScopeBusiness scopeBusiness = request.getO(ScopeBusiness.class);
        return scopeBusinessRepository.saveAndFlush(scopeBusiness);
    }

    public String delete(SimpleRequest request) {
        ScopeBusiness scopeBusiness = request.getO(ScopeBusiness.class);
        scopeBusinessRepository.delete(scopeBusiness);
        return "删除成功";
    }
}
